package de.stefanocke.roo.xtend;

import java.util.List;

import org.eclipse.xtext.xbase.lib.Functions.Function0;
import org.springframework.roo.classpath.details.annotations.AnnotationMetadataBuilder;
import org.springframework.roo.model.JavaSymbolName;
import org.springframework.roo.model.JavaType;

public class Method {
	private MethodSignature signature;
	private Function0<CharSequence> body;

	public Method(MethodSignature signature, Function0<CharSequence> body) {
		super();
		this.signature = signature;
		this.body = body;
	}

	public MethodSignature getSignature() {
		return signature;
	}

	public void setSignature(MethodSignature signature) {
		this.signature = signature;
	}

	public Function0<CharSequence> getBody() {
		return body;
	}

	public void setBody(Function0<CharSequence> body) {
		this.body = body;
	}
	
	

	public boolean isConstructor() {
		return signature.isConstructor();
	}

	public List<AnnotationMetadataBuilder> getAnnotations() {
		return signature.getAnnotations();
	}

	public int getModifier() {
		return signature.getModifier();
	}

	public JavaType getReturnType() {
		return signature.getReturnType();
	}

	public JavaSymbolName getName() {
		return signature.getName();
	}

	public List<Parameter> getParameters() {
		return signature.getParameters();
	}

	public List<JavaType> getExceptions() {
		return signature.getExceptions();
	}

	public static Method method(MethodSignature signature, Function0<CharSequence> body) {
		return new Method(signature, body);
	}
	
	

}
